/*
 * Node.h
 *
 *  Created on: May 21, 2011
 *      Author: trungtq
 */

#ifndef NODE_H_
#define NODE_H_


#include "Term.h"
#include "Equation.h"
#include "OutLabel.h"

class Node {
private:
    Term data;
    Node* parent;
    OutLabel *outLabel;
    int  rank;

public:
    Node();
    Node(Term data);
    virtual ~Node();
    Term getData() const;
    string toString();
    Node* getParent() const;
    int getRank() const;
    OutLabel* getOutLabel() const;
    string stringOfOutLabel();
    string stringOfData() const;
    void setData(Term data);
    void setParent(Node* parent);
    void setRank(int rank);
    void setOutLabel(OutLabel* label);
    void removeOutLabel();

public:
    bool equal(Node other);
};


class NodeCompare {
public:
    bool operator() (Node* node1, Node* node2) {
        return (node1 < node2);
    }
};

typedef set<Node*, NodeCompare>        NodeSet;

#endif /* NODE_H_ */
